package team.seekers.hula.audit.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import team.seekers.hula.audit.entity.dto.ReportAddDTO;
import team.seekers.hula.audit.service.AuditService;
import team.seekers.hula.auth.service.MindUtils;
import team.seekers.hula.common.annotation.ApiResponseBody;

import javax.validation.Valid;

@Controller
@ApiResponseBody
@RequestMapping("/audit")
public class AuditController {

    @Autowired
    private AuditService auditService;


    /**
     * 举报
     */
    @PostMapping("/report")
    public void report(@Valid @RequestBody ReportAddDTO reportAddDto) {
        reportAddDto.setUserId(MindUtils.getUserId());
        auditService.report(reportAddDto);
    }



}
